<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>标题3</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" href="icons/iconfont.css">
<style>
	
	.lis{float:left;padding:30px 10px;}
	/*.d1{float:left;width:245px;height:362px;margin-right:20px;}
	.d1 img{width:245px;height:245px;}
	.p1{color:red;}
	.p2{color:blue;}*/
</style>
</head>
<body>
	<div class="nameq">111</div>
</body>
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<script>

var aa=localStorage.getItem('userID');
if(aa){
	$('.nameq').html(aa).css('color','red');
}


$.ajax({
	type:'get',
	url:'http://datainfo.duapp.com/shopdata/getclass.php',
	dataType:'json',
	success:function(data){
		$.each(data,function(index){
			var lis=$('<div class="dq"><i class="iconfont lis">'+data[index].icon+'</i></div>');
			$('body').append(lis);
		})
	}
})

function getgoods(classID,pageCode){
	$.ajax({
		type:'get',
		url:'http://datainfo.duapp.com/shopdata/getGoods.php',
		data:{classID:classID,pageCode:pageCode},
		dataType:'jsonp',
		success:function(data){
			$.each(data,function(index){
				console.log(data[index])
				var box=$('<div class="d1"></div>');
				var imgs=$("<img src='"+data[index].goodsListImg+"' />");
				var pic=$('<p class="p1">'+data[index].price+'</p>');
				var names=$('<p class="p2">'+data[index].goodsName+'</p>');

				box.append(imgs);
				box.append(names);
				box.append(pic);
				$('body').append(box);
			})
		}
	})
}
getgoods(1,0)
</script>
</html>